// const routes = createRouter({
//     history: createWebHistory(),
//     routes: [{
//             path: '/',
//             redirect: '/index',
//             component: () =>
//                 import ('../page/Index.vue'),
//             meta: { title: '首页' },
//             children: [{
//                     path: '/index',
//                     name: "index",
//                     component: () =>
//                         import ('../page/subpage/index.vue'),
//                     meta: { title: '首页' },
//                 }, {
//                     path: "/category",
//                     name: "category",
//                     component: () =>
//                         import ('../page/subpage/category.vue'),
//                     meta: { title: '分类' },
//                 }, {
//                     path: "good",
//                     name: "good",
//                     component: () =>
//                         import ('../page/subpage/good.vue'),
//                     meta: { title: '商品' },
//                 }



//             ]

//         }, {
//             path: '/login',
//             name: 'login',

//             component: () =>
//                 import ('../page/Login.vue'),
//             meta: { title: '登录' }




//         }, {
//             path: "/setting",
//             name: 'setting',
//             component: () =>
//                 import ("../page/subpage/setting.vue"),
//             meta: {
//                 title: '设置'
//             }
//         }

//     ]
// })
// export default routes;


















import {
    createRouter,
    createWebHistory
} from 'vue-router'

const routes = createRouter({
    history: createWebHistory(),
    routes: [{
        path: "/",
        redirect: "/index",
        component: () =>
            import ('../page/Index.vue'),
        children: [{
                path: "/index",
                name: 'index',
                component: () =>
                    import ("../page/subpage/index.vue"),
                meta: {
                    title: '首页'
                }
            },
            {
                path: "/category",
                name: 'category',
                component: () =>
                    import ("../page/subpage/category.vue"),
                meta: {
                    title: '分类'
                }
            }, {
                path: "/good",
                name: 'good',
                component: () =>
                    import ("../page/subpage/good.vue"),
                meta: {
                    title: '商品'
                }
            }, {
                path: "/setting",
                name: 'setting',
                component: () =>
                    import ("../page/subpage/setting.vue"),
                meta: {
                    title: '设置'
                }
            },

        ]
    }, {
        path: "/login",
        name: "login",
        component: () =>
            import ('../page/Login.vue'),
        meta: {
            title: '登录'
        }
    }]
})

export default routes;